import java.util.Arrays;

public class Main {
	public static void Test7(String[] args) {
		int[][] A = new int[][] { { 0, 0, 1, 1 }, { 1, 0, 1, 0 },
				{ 0, 1, 1, 0 }, { 0, 0, 1, 0 } };
		int[][] f = new int[][] { { 2, 2 }, { 3, 3 }, { 4, 4 } };

		int[][] flipChess = flipChess(A, f);
		for (int[] is : flipChess) {
			System.out.println(Arrays.toString(is));
		}
		System.out.println(2 & 1);
	}

	public static int[][] flipChess(int[][] A, int[][] f) {
		for (int i = 0; i < 3; i++) {
			int x = f[i][0] - 1;
			int y = f[i][1] - 1;
			// { 0, 0, 1, 1 }, { 1, 0, 1, 0 },{ 0, 1, 1, 0 }, { 0, 0, 1, 0 }
			// 对上进行反转
			try {
				A[x - 1][y] = (A[x - 1][y]) + 1 & 1;
			} catch (Exception e1) {
				// TODO Auto-generated catch block
			}

			// 对下进行反转

			try {
				A[x + 1][y] = (A[x + 1][y]) + 1 & 1;
			} catch (Exception e) {
				// TODO Auto-generated catch block
			}

			// 对左进行反转
			try {
				A[x][y - 1] = (A[x][y - 1]) + 1 & 1;
			} catch (Exception e) {
				// TODO Auto-generated catch block
			}

			// 对右进行反转
			try {
				A[x][y + 1] = (A[x][y + 1]) + 1 & 1;
			} catch (Exception e) {
				// TODO Auto-generated catch block
			}

		}
		return A;
	}
}
